#include <fstream>
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main(int argc, char* argv[]){
	if(argc!=4){
		cout<<"wrong args, data_generator.exe [m] [n]  [legendre degree]"<<endl;
		return 1;
	}
	int m,n,ld;
	m=atoi(argv[1]);
	n=atoi(argv[2]);
	ld=atoi(argv[3]);
	cout<<"parameters: m n for ssi= "<<m<<" "<<n<<endl;
	cout<<"max. legendre degree= "<<ld<<endl;
	
	ofstream coef("_al_coef.dat");
	coef<<setprecision(14);
	coef<<m<<" "<<n<<endl;
	for(size_t i=0;i<=m;i++){
		for(size_t j=0;j<=n;j++){
			double tmp = j==0?0.0:(2*j+1)/pow((double)j*(j+1),(double)i);
			coef<<tmp<<' ';
		}
		coef<<endl;
	}
	coef.close();
	return 0;
}